package com.xqls.dal.dao.mybatis;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.xqls.dal.dao.PublicStormwaterRealdataDao;
import com.xqls.dal.model.PublicStormwaterRealdata;
import com.xqls.dal.model.PublicStormwaterRealdataExample;
import com.xqls.dal.service.PublicStormwaterRealdataMapper;
@Repository
public class PublicStormwaterRealdataDaoImpl implements PublicStormwaterRealdataDao{
	@Autowired PublicStormwaterRealdataMapper mapper;
	@Override
	public int insertPublicStormwaterRealdata(PublicStormwaterRealdata publicStormwaterRealdata) {
		return mapper.insert(publicStormwaterRealdata);
	}
	
	public int updatePublicStormwaterRealdata(PublicStormwaterRealdata publicStormwaterRealdata){
		return mapper.updateByPrimaryKey(publicStormwaterRealdata);
	}
	public PublicStormwaterRealdata queryByRealdataNo(Integer realdataNo){
		return mapper.selectByPrimaryKey(realdataNo);
	}
	
	public List<PublicStormwaterRealdata> queryByDeviceNo(String deviceNo){
		PublicStormwaterRealdataExample example=new PublicStormwaterRealdataExample();
		example.createCriteria().andDeviceNoEqualTo(deviceNo);
		return mapper.selectByExample(example);
	}

	@Override
	public List<Map<String, Object>> selectByMap(Map<String, Object> map) {
		return mapper.selectByMap(map);
	}
	
	@Override
	public List<Map<String, Object>> queryAll() {
		
		return mapper.selectAll();
	}
	
	public PublicStormwaterRealdata selectByDeviceNo(String deviceNo){
		return mapper.selectBydeviceNo(deviceNo);
	}

	@Override
	public List<PublicStormwaterRealdata> selectListByMap(Map<String, Object> map) {
		return mapper.selectListByMap(map);
	}

	@Override
	public List<PublicStormwaterRealdata> selectPublic() {
		return mapper.selectPublic();
	}

}
